@isTest
public class Testclass{
public static testMethod void testBatch() {

user u = [SELECT ID, UserName FROM User
WHERE username='sai.suzuki.sagar@gmail.com'];
user u2 = [SELECT ID, UserName FROM User
WHERE username='sai.chilakapati@wipro.com'];
List<Parent__c> ac = [Select Id,OwnerId from Parent__c where OwnerId = : u2.Id]; 
// Create 200 test accounts - this simulates one execute.
// Important - the Apex test framework only allows you to
// test one execute.
List <Parent__c> invs = new List<Parent__c>();
for(Integer i = 0; i<200; i++){
Parent__c a = new Parent__c(Description__c ='Invoice '+'i', Ownerid = u.ID);
invs.add(a);
}
insert invs;
Test.StartTest();
OwnerReassignment reassign = new OwnerReassignment();
reassign.query='SELECT Id, Name, Ownerid ' +
'FROM parent__c ' +
'WHERE OwnerId=\'' + u.Id + '\'' +
' LIMIT 200';
reassign.email='csaisagar@gmail.com';
reassign.fromUserId = u.Id;
reassign.toUserId = u2.Id;
ID batchprocessid = Database.executeBatch(reassign);
Test.StopTest();
System.AssertEquals(ac.Size(),200);
}
}